﻿using System;
using System.Buffers;
using Beefly.Json.Extensions;
using Beefly.Json.Meta;

namespace Beefly.Json.Formats;

sealed class CharJsonFormat : AJsonFormat<char>
{
    public override void Serialize(IBufferWriter<char> writer, ref char item)
    {
        writer.WriteChar(item);
    }

    public override char Deserialize(in Span<char> str)
    {
        return str[0];
    }
}

